package com.tanhua.server.utils;

import com.tanhua.server.pojo.User;

public class UserThreadLocal {
    //ThreadLocal 保证同一线程的数据共享
    private final static ThreadLocal<User> LOCAL = new ThreadLocal<>();

    public static void set(User user){
        LOCAL.set(user);
    }

    public static User get(){
        return LOCAL.get();
    }
}
